home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 2 / Mac Magazin and MacEasy Magazine CD - Issue 02.iso / Sharewarebibliothek / Applikationen / Alpha.5.81 folder / sample / userStartup.tcl
Text File  |  1994-07-28  |  3KB  |  92 lines

  1. #================================================================================
  2. proc red {} {
  3.     colorize [getPos] [selEnd] red
  4. }
  5. proc blue {} {
  6.     colorize [getPos] [selEnd] blue
  7. }
  8. proc yellow {} {
  9.     colorize [getPos] [selEnd] yellow
  10. }
  11. proc newColor {} {
  12.     colorize [getPos] [selEnd] [listpick -p "Color?" {red black yellow magenta white green blue cyan}]
  13. }
  14. proc colorCComment {} {
  15.     insertText {/}
  16.     if {([set pos [getPos]] >= 3) && ([lookAt [expr $pos - 2]] == "*")} {
  17.         if {![catch {search -f 0 -r 0 -i 0 {/*} $pos} res]} {
  18.             colorize [lindex $res 0] $pos red
  19.         }
  20.     }
  21. }
  22. bind '/' colorCComment
  23.  
  24. addMenuItem -m colors "(-"
  25. addMenuItem -m colors "bold"
  26. addMenuItem -m colors "italic"
  27. addMenuItem -m colors "normal"
  28.  
  29. proc colorizeTclComments {} {
  30. }
  31.  
  32.  
  33. #================================================================================
  34. # This is my current 'userStartup.tcl'. Use this as an example of what can
  35. # be done. Do not use any of this directly, as the your files are doubtless in
  36. # different locations than mine.
  37. #================================================================================
  38.  
  39. init 1 2
  40.  
  41. set backDir "$HOME:back"
  42.  
  43. makeMenuPermanent $thinkMenu
  44. source $HOME:tcl:SystemCode:think.tcl
  45. insertMenu $thinkMenu
  46.  
  47.  
  48. #================================================================================
  49. # Redefinition of 'latex' from latex.tcl. It sends an additional open event to 
  50.  
  51. # Textures. 
  52. proc latex {} {
  53.     global latexPath
  54.     set sig ""
  55.     catch {string trim [lindex [getfinfo $latexPath] 1] '} sig
  56.     set name [checkRunning latex $sig latexPath]
  57.     if {![string length $name]} return
  58.     switchTo $name
  59.     catch {sendOpenEvent -n $name [lindex [winNames -f] 0]}
  60. }
  61.  
  62. #================================================================================
  63.  
  64. set backup 1
  65. if {[file exists "$HOME:EditSource"]} {
  66.     set fileSets(Editor) [glob -t TEXT "$HOME:EditSource:*.c"]
  67.     addMenuItem -m fileSets "Editor"
  68. }
  69.  
  70. # source "$HOME:sample:filesetMenu.tcl"
  71.  
  72. set horScrollBar 0
  73.  
  74. #================================================================================
  75. # Lines added automatically.
  76. #================================================================================
  77.  
  78.  
  79. set thinkName "PowerPete:Development:Symantec C++ for Macintosh:THINK Project Manager"
  80. set excaliburPath "PowerPete:Textures:Excalibur1.4.1:Excalibur 1.4.1"
  81. set latexPath "PowerPete:Textures:Textures™ 1.6.2a1"
  82. set toolserverPath "PowerPete:Utils:ToolServer"
  83. set referencePath "PowerPete:Buckaroo:Buckaroo 2.0b1"
  84.  
  85. set excaliburPath "PowerPete:Excalibur1.4.1:Excalibur 1.4.1"
  86.  
  87. set "fileSets(Tcl 7.3)" [glob -t TEXT  "PowerPete:Development:Alpha:Tcl 7.3:*.c"]
  88. addMenuItem -m fileSets "Tcl 7.3"
  89. set "fileSets(Mac Tcl)" [glob -t TEXT  "PowerPete:Development:Alpha:Tcl 7.3:MacTcl Source:*.c"]
  90. addMenuItem -m fileSets "Mac Tcl"
  91.  
  92.